package com.euond.accv.mdm.api.controller;

import com.euond.accv.mdm.client.dto.BasConfigDTO;
import com.euond.accv.mdm.client.dto.MdmStoreDTO;
import com.euond.accv.mdm.domain.BasConfig;
import com.euond.accv.mdm.domain.MdmStore;
import com.euond.accv.mdm.service.BasConfigService;
import com.euond.accv.mdm.service.MdmStoreService;
import com.euond.common.api.controller.BaseReadApiController;
import com.euond.common.util.BeanMapper;
import com.euond.common.web.controller.annotation.FeignRestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created by liqi on 2017/3/16.
 */
@FeignRestController
@RequestMapping("/feign_api/bas_config")
@Api(description = "配置Api")
public class BasConfigApiController extends BaseReadApiController<BasConfig,Integer> {

    @Autowired
    BasConfigService service;

    @Override
    protected void init() {
        setBaseService(service);
        setMainVOClazz(BasConfigDTO.class);
    }

    @ApiOperation(value = "", httpMethod="GET")
    @GetMapping("/findConfigById")
    public BasConfigDTO findOneById(@RequestParam("id") Integer id){
        BasConfig basConfig = service.findOne(id);
        BasConfigDTO dto = BeanMapper.map(basConfig, BasConfigDTO.class);
        return dto;
    }
}
